/*
 *  Class name: FileHandler.java
 *  Version: 1.0
 *  Date: 3.6.2014
 */
package cz.muni.fi.pv168.addressbook.utils;

import java.io.File;
import java.io.IOException;

/**
 *
 * @author Michal Ďuriš
 */
public class FileHandler {

    private FileHandler() {

    }

    public static void createFile(String pathName) throws IOException {
        createFile(new File(pathName));
    }

    public static boolean createFile(File file) throws IOException {

        File fileDirectories = file.getParentFile();

        if (fileDirectories != null) {
            fileDirectories.mkdirs();
        }

        return file.createNewFile();
    }
}
